<template>
  <div class="container">
    <div class="display_flex_wrap">
      <div class="classroom" v-for="(item, index) in allDevList" :key="index">
        <div class="classRoomName activeRoom display_flex3 align-items">
          <el-radio
            size="large"
            checked
            style="margin-left: 20px"
            v-if="item.isOnline == 1"
          >
            在线
          </el-radio>
          <el-radio
            size="large"
            checked
            style="margin-left: 20px"
            disabled
            v-if="item.isOnline == 0"
          >
            离线
          </el-radio>
        </div>
        <div class="display_flex3 align-items">
          <img
            class="icon1"
            src="../../assets/img/53bg.png"
          />
          <div class="modle_content">
            <div class="device_title">型号：{{ item.devName }}</div>
            <div class="device_title">告警内容：{{ item.alarmContent }}</div>
            <div class="device_title">漏电流：{{ item.leakageCurrent }}</div>
            <div class="device_title">温度：{{ item.temperature }}</div>
          </div>
        </div>
        <div class="modle_content1 display_flex3 align-items">
          <div class="borderLeft">
            <div class="display_flex3 align-items">
              <img class="icon2" src="../../assets/img/icon1.png" />
              <div class="device_title">电压(V)</div>
            </div>
            <div class="device_value">{{ item.voltage }}</div>
          </div>
          <div class="borderLeft">
            <div class="display_flex3 align-items">
              <img class="icon2" src="../../assets/img/icon2.png" />
              <div class="device_title">电流(A)</div>
            </div>
            <div class="device_value">{{ item.current }}</div>
          </div>
          <div class="padding-left">
            <div class="display_flex3 align-items">
              <img class="icon2" src="../../assets/img/icon1.png" />
              <div class="device_title">功率(W)</div>
            </div>
            <div class="device_value">{{ item.power }}</div>
          </div>
        </div>
        <!-- <div class="display_flex3 justify-content-center remarkValue">
          <el-button type="primary" @click="handledevice(item)">分闸</el-button>
          <el-button type="primary" @click="handledevice(item)">自检</el-button>
          <el-button type="primary" @click="handleSchedule(item)"
            >报表管理</el-button
          >
        </div> -->
      </div>
      <div v-if="allDevList.length == 0" class="nodata">暂无数据</div>
    </div>
  </div>
</template>
<script>
import axios from "axios";
import { ref, reactive, onMounted } from "vue";
import { ElMessage, ElMessageBox } from "element-plus";
import api from "../../api/api";
export default {
  setup(props, context) {
    const query = reactive({
      queryAreaCode: "",
      pageNum: 1,
      pageSize: 15,
    });
    const allDevList = ref([{
		devName:"zt-Q232323",
		alarmContent:"温度过高",
		leakageCurrent:"12",
		temperature:"40",
		voltage:220,
		current:12,
		power:1500
	},{
		devName:"zt-Q232323",
		alarmContent:"温度过高",
		leakageCurrent:"12",
		temperature:"40",
		voltage:220,
		current:12,
		power:1500
	},{
		devName:"zt-Q232323",
		alarmContent:"温度过高",
		leakageCurrent:"12",
		temperature:"40",
		voltage:220,
		current:12,
		power:1500
	},{
		devName:"zt-Q232323",
		alarmContent:"温度过高",
		leakageCurrent:"12",
		temperature:"40",
		voltage:220,
		current:12,
		power:1500
	}]);
    const getElectricityDataInfo = () => {
      let areaCode = localStorage.getItem("projectAreaCode");
      api
        .getListAPI("backup/electricityArea/getAllDevOfArea", {
          areaCode: areaCode,
        })
        .then((res) => {
          if (res.data.code == 1) {
            allDevList.value = res.data.data;
          } else {
            ElMessage.error(res.data.message);
          }
          //数据处理
        })
        .catch((err) => {
          console.log(err);
        });
    };
    // getElectricityDataInfo();
    return {
      query,
      allDevList,
    };
  },
};
</script>
<style lang="less" scoped>
@import "../../assets/css/common.css";
.container {
  width: 100%;
  padding: 0;
  padding-bottom: 20px;
}
.classroom {
  width: 300px;
  // height: 312px;
  background: #ffffff;
  box-shadow: 0px 0px 10px 0px rgba(145, 143, 143, 0.75);
  border-radius: 4px;
  margin-left: 20px;
  display: flex;
  flex-direction: column;
  // margin-bottom: 20px;
  margin-top: 20px;
}
.classroom > div {
  font-size: 16px;
  font-family: Source Han Sans CN;
  font-weight: 400;
  color: #333333;
  line-height: 30px;
}
.classroom > div:nth-child(1) {
  // text-align: center;
  color: #333;
  //   border-bottom: 1px solid rgba(223, 223, 223, 0.699);
}
.device_title {
  //   width: 70px;
  font-size: 14px;
  font-family: Source Han Sans CN;
  font-weight: 400;
  color: #333333;
  line-height: 26px;
}
.device_value {
  color: #333;
  margin-left: 20px;
}
.devState {
  color: #129e29;
  margin-left: 20px;
}
.modle_content {
  margin-left: 20px;
}
.modle_content1 {
  margin-left: 20px;
  border-top: 1px solid #e6e6e6;
  border-bottom: 1px solid #e6e6e6;
  padding: 10px 0;
  width: 90%;
}
.modle_content1 > div {
  flex: 1;
}
.borderLeft {
  border-right: 1px solid #e6e6e6;
  padding-left: 10px;
}
.padding-left {
  padding-left: 10px;
}
.classRoomName {
  height: 47px;
  border-radius: 10px 10px 0 0;
  font-size: 16px;
  font-family: Source Han Sans CN;
  font-weight: 400;
  // color:#ffffff !important;
  line-height: 40px !important;
}
.classRoomName .classRoomN {
  font-size: 14px;
  // width: 125px;
  line-height: 15px;
  // overflow: hidden;
  // text-overflow: ellipsis;
  // display: -webkit-box;
  // white-space: nowrap; // 默认不换行；
}
.unactiveRoom {
  background-color: rgb(84 90 101);
  border: 2px solid rgb(179, 179, 179);
}
.classSchedule {
  width: 54px;
  height: 24px;
  padding: 0;
  margin: 0 20px;
  font-size: 12px;
  font-family: Microsoft YaHei;
  // margin-top: 10px;
}
.roomIcon {
  height: 20px;
  width: 20px;
  padding-left: 20px;
  padding-right: 5px;
}
.icon1 {
  width: 100px;
  height: 100px;
  margin-left: 14px;
}
.icon2 {
  height: 14px;
  width: 14px;
  padding-right: 5px;
}
.nodata {
  width: 100%;
  text-align: center;
  padding-bottom: 30px;
}
</style>